/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.uml_generator.manager;

import com.genia.toolbox.basics.exception.BundledException;
import com.genia.toolbox.basics.exception.technical.TechnicalIOException;
import com.genia.toolbox.uml_generator.bean.ModelGeneratorContext;
import com.genia.toolbox.uml_generator.model.AbstractDelegatableObject;
import com.genia.toolbox.uml_generator.model.AbstractJavaObject;
import com.genia.toolbox.uml_generator.model.AttributeModel;
import com.genia.toolbox.uml_generator.model.OperationModel;

/**
 * Manager that will print datas.
 */
public interface PrinterManager
{

  /**
   * print the package declaration.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param object
   *          the object being printed
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printPackage(T out, AbstractJavaObject object)
      throws TechnicalIOException;



  /**
   * print the dependencies.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param context
   *          the context of the generation
   * @param out
   *          the {@link Appendable} to print to
   * @param object
   *          the object being printed
   * @param otherInterfaces
   *          other interfaces the the object must implement
   * @return the {@link Appendable} that has been print to
   * @throws BundledException
   *           when an error occurred
   */
  public <T extends Appendable> T printDependencies(ModelGeneratorContext context, T out, AbstractDelegatableObject object, AbstractJavaObject... otherInterfaces)
      throws BundledException;



  /**
   * print javadoc comment.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param comments
   *          the comments to print.
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printComment(T out, String... comments)
      throws TechnicalIOException;



  /**
   * print the declaration of an {@link OperationModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param operation
   *          the operation to write the declaration for
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printDeclaration(T out, OperationModel operation)
      throws TechnicalIOException;



  /**
   * print the signature of an {@link OperationModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param operation
   *          the operation to write the signature for
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printSignature(T out, OperationModel operation)
      throws TechnicalIOException;



  /**
   * print an {@link OperationModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param operation
   *          the operation to write
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printMethod(T out, OperationModel operation)
      throws TechnicalIOException;



  /**
   * print the declaration of an {@link AttributeModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param attribute
   *          the attribute to write the declaration for
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printDeclaration(T out, AttributeModel attribute)
      throws TechnicalIOException;



  /**
   * print the signature of an {@link AttributeModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param attribute
   *          the attribute to write the signature for
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printSignature(T out, AttributeModel attribute)
      throws TechnicalIOException;



  /**
   * print an {@link AttributeModel}.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param attribute
   *          the attribute to write
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printAttribute(T out, AttributeModel attribute)
      throws TechnicalIOException;
}
